const initialState ={
    currentshopinfo:{},
    currentshoplist:[],
    des:"xxxx",
    defaultaddress:{}
}
const all =(state=[],action)=>{
switch(action.type){
    case 'SETCURRENTSHOPLIST':return action.payload;
    default:return state;
}
    
}
const shopinfo=(state={},action)=>{
    switch(action.type){
        case 'CURRENTSHOPINFO':return action.payload;
        default:return state;
    }
}
const setaddress=(state={},action)=>{
    switch(action.type){
        case 'SETADDRESS':return {...action.payload};
        default:return state;
    }
}
export default (state=initialState,action) => {
    return {
        currentshoplist:all(state.currentshoplist,action),
        des:state.des,
        currentshopinfo:shopinfo(state.currentshopinfo,action),
        defaultaddress:setaddress(state.defaultaddress,action)
    }
}
